$(function() {
	$('#vue_vm_list div').hide();
});

withdrawApply_findAll();

function withdrawApply_findAll() {
	if($('#vue_vm_list').length==0) {return;}
	$('#vue_vm_list div').hide();
	
	findAll_basic(path+'/withdrawApply/findAll', function(response) {	
		$('#vue_vm_list').html(gl_vue_vm_list_html);
		
		for(var i=0; i<response.data.length; i++) {
			response.data[i].index = i+1;
		}
		
		new Vue({
			el: '#vue_vm_list',
			data: {
				todos: response.data
			},
			methods: {
				withdrawApply_handleApply:function(todo) {
					var id = todo.withdrawApplyId;
					var withdrawWay = $('input:radio[name="'+todo.withdrawApplyId+'_withdrawWay"]:checked').val();
					
					if(confirm('确实要处理提现申请吗？')) {
						save_basic_by_json(path+'/withdrawApply/handleApply', {id:id, withdrawWay:withdrawWay}, function() {
							$('#'+todo.withdrawApplyId+'_handle_button').remove();
							alert('提现申请处理成功');
						});
					}
				}
			}
		});
		
		$('#vue_vm_list div').show();
	});
}